package com.houtaipeingboot.service.impl;


import com.houtaipeingboot.mapper.LoginDao;
import com.houtaipeingboot.pojo.Login;
import com.houtaipeingboot.service.LoginService;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginServiceImpl implements LoginService {
@Autowired
private LoginDao ld;
    @Override
    public Login getLoginBySome(Login l) {
        return ld.getLoginBySome(l);
    }

    @Override
    public boolean updatePwd(Login l, String lname,String newpwd) {
        Login login = ld.getLoginBySome(l);

        if(login == null){
            return false;
        }else {
           int i = ld.updatePwd(lname,newpwd);
           if (i==0){
               return false;
           }else {
               return true;
           }

        }
    }
}
